$.ajax({
    type: 'get',
    url: '/posts/recommend',
    success: function(response) {
        console.log(response);

        var tpl = `
        {{each data}}
        <li>
            <a href="javascript:;">
                <img src="{{$value.thumbnail}}" alt="" />
                <span>{{$value.title}}</span>
            </a>
        </li>
        {{/each}}
        `;
        var html = template.render(tpl, { data: response });
        $('.hots ul').html(html);
    }
});
